import React, { Suspense, lazy } from 'react';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import '@global/global.scss';
import './App.scss';

const Index = lazy(() => import('@pages/index'));
const NotFind = lazy(() => import('@pages/notFind'));

function App() {
  return (
    <div className='App'>
      <BrowserRouter>
        <Suspense fallback={<div>加载中...</div>}>
          <Routes>
            <Route path='index' element={<Index />} />
            <Route path='*' element={<NotFind />} />
          </Routes>
        </Suspense>
      </BrowserRouter>
    </div>
  );
}

export default App;
